home *** CD-ROM | disk | FTP | other *** search
/ CD School House 9 / CD School House 9.0 - Wayzata Technology (1994).iso / pc / dos / teachaid / pccai / caiarc2.exe / FUNCTION.CAI < prev    next >
Text File  |  1993-12-06  |  1KB  |  45 lines

  1. .rem                                                                 
  2. .rem -----------------PRESS CTRL-G (Go) TO RUN THIS PROGRAM--------- 
  3. .rem                                                                 
  4. @LABEL:THETOP
  5. @OPTIONS ESCAPE:BEGIN
  6. .fun1 =shell:txhelp cai.hlp Go:thetop
  7. .rem NOTE: after a shell, you need to go to a label that will redefine
  8. .rem @OPTIONS and fun commands, otherwise their meaning may be lost.
  9. .fun2 =go:endprog
  10. @LABEL:REALBEGIN
  11. .color 15,1
  12. .cls
  13. .cen (*DEMO of the @OPTIONS and FUN(CTION) commands*)
  14.  
  15. In this program the command @OPTIONS ESCAPE:BEGIN tells the program to
  16. go to the label called BEGIN when the ESC key is pressed.
  17.  
  18. The commands @FUN# where # is a number from 1 to 9 tells the program
  19. to go to a label when one of the function keys are pressed.
  20.  
  21. For this example the following keys are defined:
  22.  
  23.       F1 - means shell to the TXHELP program
  24.       F2 - means go to the label called ENDPROG - which ends this program.
  25.  
  26.  
  27. Try it out...Press Esc, F1 or F2 now...(yes, even at the pause prompt.)
  28. .locate 24,1
  29. .pause
  30. @STOP system
  31. @label:begin
  32. .cls
  33. .locate 10,1
  34. You came here by pressing the Esc key.
  35. .locate 24,1
  36. .pause
  37. @GOBACK:REALBEGIN
  38. @LABEL:ENDPROG
  39. .cls
  40. .locate 10,1
  41. You came here by pressing the F2 key. Now the program will end.
  42. .locate 24,1
  43. .pause
  44.  
  45.